package com.goatrock.media.thisway.common.model;

import java.util.Arrays;
/**
 *
 * @author Rich
 */
public class Title extends BaseDTO implements Comparable<Title>{

    private String localTitle = null;
    private String originalTitle = null;
    private String sortTitle = null;
    private String added = null;
    private String productionYear = null;
    private String runningTime = null;
    private String imdbRating = null;
    private String mpaaRating = null;
    private String description = null;
    private String type = null;
    private String aspectRatio = null;
    private String lockData = null;
    private String imdb = null;
    private String tmdbId = null;
    private String forcedTitle = null;
    private String revenue = null;
    private String budget = null;
    private String cdUniverseId = null;
    private String imdbId = null;
    private String baseFileLocation = null;
    private String[] genres = null;
    private String[] studios = null;
    private Person[] persons = null;
    private Boolean hasXMLFile = Boolean.FALSE;
    private Boolean hasFolderImage = Boolean.FALSE;
    private Boolean hasBackdropImage = Boolean.FALSE;
    private int mediaListerID = -1;
    private String[] movieFileNames = null;
    private String[] titleSize = null;


    public void addMovieFileName(String fileName){
        this.setMovieFileNames(this.addElementToStringArray(fileName, this.getMovieFileNames()));
    }

    public void addTitleSize(String size){
        this.setTitleSize(this.addElementToStringArray(size, this.getTitleSize()));
    }

    public String getAdded() {
        return added;
    }

    public void setAdded(String added) {
        this.added = added;
    }

    public String getAspectRatio() {
        return aspectRatio;
    }

    public void setAspectRatio(String aspectRatio) {
        this.aspectRatio = aspectRatio;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getImdb() {
        return imdb;
    }

    public void setImdb(String imdb) {
        this.imdb = imdb;
    }

    public String getImdbRating() {
        return imdbRating;
    }

    public void setImdbRating(String imdbRating) {
        this.imdbRating = imdbRating;
    }

    public String getLocalTitle() {
        return localTitle;
    }

    public void setLocalTitle(String localTitle) {
        this.localTitle = localTitle;
    }

    public String getLockData() {
        return lockData;
    }

    public void setLockData(String lockData) {
        this.lockData = lockData;
    }

    public String getMpaaRating() {
        return mpaaRating;
    }

    public void setMpaaRating(String mpaaRating) {
        this.mpaaRating = mpaaRating;
    }

    public String getOriginalTitle() {
        return originalTitle;
    }

    public void setOriginalTitle(String originalTitle) {
        this.originalTitle = originalTitle;
    }

    public String getProductionYear() {
        return productionYear;
    }

    public void setProductionYear(String productionYear) {
        this.productionYear = productionYear;
    }

    public String getRunningTime() {
        return runningTime;
    }

    public void setRunningTime(String runningTime) {
        this.runningTime = runningTime;
    }

    public String getSortTitle() {
        if (this.sortTitle != null){
            return sortTitle;
        }
        else {
            return this.localTitle;
        }
    }

    public void setSortTitle(String sortTitle) {
        this.sortTitle = sortTitle;
    }

    public String getTmdbId() {
        return tmdbId;
    }

    public void setTmdbId(String tmdbId) {
        this.tmdbId = tmdbId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String[] getGenres() {
        return genres;
    }

    public void setGenres(String[] genres) {
        this.genres = genres.clone();
    }

    public String[] getStudios() {
        return studios;
    }

    public void setStudios(String[] studios) {
        this.studios = studios.clone();
    }

    public Person[] getPersons() {
        return persons;
    }

    public void setPersons(Person[] persons) {
        this.persons = persons.clone();
    }

    public String getBaseFileLocation() {
        return baseFileLocation;
    }

    public void setBaseFileLocation(String baseFileLocation) {
        this.baseFileLocation = baseFileLocation;
    }

    public String[] getMovieFileNames() {
        return movieFileNames;
    }

    public void setMovieFileNames(String[] movieFileNames) {
        this.movieFileNames = movieFileNames.clone();
    }

    public Boolean getHasBackdropImage() {
        return hasBackdropImage;
    }

    public void setHasBackdropImage(Boolean hasBackdropImage) {
        this.hasBackdropImage = hasBackdropImage;
    }

    public Boolean getHasFolderImage() {
        return hasFolderImage;
    }

    public void setHasFolderImage(Boolean hasFolderImage) {
        this.hasFolderImage = hasFolderImage;
    }

    public String[] getTitleSize() {
        return titleSize;
    }

    public void setTitleSize(String[] titleSize) {
        this.titleSize = titleSize.clone();
    }

    public Boolean getHasXMLFile() {
        return hasXMLFile;
    }

    public void setHasXMLFile(Boolean hasXMLFile) {
        this.hasXMLFile = hasXMLFile;
    }

    public String getBudget() {
        return budget;
    }

    public void setBudget(String budget) {
        this.budget = budget;
    }

    public String getCdUniverseId() {
        return cdUniverseId;
    }

    public void setCdUniverseId(String cdUniverseId) {
        this.cdUniverseId = cdUniverseId;
    }

    public String getForcedTitle() {
        return forcedTitle;
    }

    public void setForcedTitle(String forcedTitle) {
        this.forcedTitle = forcedTitle;
    }

    public String getImdbId() {
        return imdbId;
    }

    public void setImdbId(String imdbId) {
        this.imdbId = imdbId;
    }


    public String getRevenue() {
        return revenue;
    }

    public void setRevenue(String revenue) {
        this.revenue = revenue;
    }

    public int getMediaListerID() {
        return mediaListerID;
    }

    public void setMediaListerID(int mediaListerID) {
        this.mediaListerID = mediaListerID;
    }

    public String toString(){
        return this.originalTitle;
    }

    public String toStringAllInfo(){
        StringBuilder sb = new StringBuilder();
        sb.append("*************************************"); sb.append("\n");
        sb.append("@Local Title: " + this.localTitle); sb.append("\n");
        sb.append("@Original Title: " + this.originalTitle); sb.append("\n");
        sb.append("@Sort Title: " + this.sortTitle); sb.append("\n");
        sb.append("@Added: " + this.added); sb.append("\n");
        sb.append("@Production Year: " + this.productionYear); sb.append("\n");
        sb.append("@Running Time: " + this.runningTime); sb.append("\n");
        sb.append("@imdbRating: " + this.imdbRating); sb.append("\n");
        sb.append("@mpaa rating: " + this.mpaaRating); sb.append("\n");
        sb.append("@Description: " + this.description); sb.append("\n");
        sb.append("@Type: " + this.type); sb.append("\n");
        sb.append("@AspectRatio: " + this.aspectRatio); sb.append("\n");
        sb.append("@LockData: " + this.lockData); sb.append("\n");
        sb.append("@IMDB: " + this.imdb); sb.append("\n");
        sb.append("@TMDBId: " + this.tmdbId); sb.append("\n");
        sb.append("@Genres: " + Arrays.toString(this.genres)); sb.append("\n");
        sb.append("@Persons: " + Arrays.toString(this.persons)); sb.append("\n");
        sb.append("@Studios: " + Arrays.toString(this.studios)); sb.append("\n");
        sb.append("@Base File Location: " + this.baseFileLocation); sb.append("\n");
        sb.append("@HasFolderImage: " + this.hasFolderImage); sb.append("\n");
        sb.append("@HasBackdropImage: " + this.hasBackdropImage); sb.append("\n");
        sb.append("@MovieFileNames: " + Arrays.toString(this.movieFileNames)); sb.append("\n");
        sb.append("@MovieSize: " + Arrays.toString(this.titleSize)); sb.append("\n");
        sb.append("*************************************"); sb.append("\n");
        return sb.toString();
    }

    public int compareTo(Title title){
        return this.getSortTitle().compareTo(title.getSortTitle());
    }
}